{extend name="public:base"}
{block name="main"}
<div class="layui-form">
  条件搜索：
  <div class="layui-inline">
    <input class="layui-input" name="start" id="start"  placeholder="请输入开始时间">
  </div>
  <div class="layui-inline">
    <input class="layui-input" name="end" id="end"  placeholder="请输入结束时间">
  </div>
  <div class="layui-inline">
    <input class="layui-input" name="keyword"  placeholder="请输入搜索关键字">
  </div>
  <div class="layui-inline">
    <button class="layui-btn" lay-filter="search" lay-submit>搜索</button>
    <button class="layui-btn layui-btn-primary"  lay-filter="search" lay-submit>重置</button>
    <button class="layui-btn layui-btn-normal" onclick="javascript:location.href='{:url("ExportExcel")}';" >导出用户</button>
    <button class="layui-btn layui-btn-normal" type="reset" data-type="reload" lay-filter="reset" lay-submit lay-event="ImportExcel">导入用户</button>
  </div>

</div>
<table class="layui-table" lay-data="{height:500,url:location.href, page:true, id:'table'}" lay-filter="table" lay-size="lg">
  <thead>
    <tr>
      <th lay-data="{field:'userid',width:75}">ID</th>
      <th lay-data="{field:'src',templet:'#src',width:75}">头像</th>
      <th lay-data="{field:'nickname'}">用户昵称</th>
      <th lay-data="{field:'tel'}">手机号</th>
      <th lay-data="{field:'email'}">邮箱</th>
      <th lay-data="{field:'status',templet:'#status',width:105}">状态</th>
      <th lay-data="{field:'addtime', sort: true}">加入时间</th>
    </tr>
  </thead>
</table>


<script>
layui.use(['table','laydate','form'], function(){
  
  table = layui.table;
  laydate = layui.laydate;
  form = layui.form;

  admin.init(['laydate','search','tool','switch']); 

});
</script>

<script type="text/html" id="link">
  <a href="{{d.link}}" class="layui-table-link" target="_blank">{{d.link}}</a>
</script>
<script type="text/html" id="src">
  <img src='{{d.src}}' width="50px;">
</script>
<script type="text/html" id="order">
  <a href="order/orderlist/userid/{{d.userid}}" style="color:#009688;"  target="_blank">点击查看</a>
</script>
<script type="text/html" id="status">
  {{#  if(d.status == 1){ }}
    <input type="checkbox" name="status" lay-skin="switch" lay-text="启用|禁用" lay-filter="status" value="{{d.userid}}" checked>
  {{#  } else { }}
    <input type="checkbox" name="status" lay-skin="switch" lay-text="启用|禁用" lay-filter="status"  value="{{d.userid}}">
  {{#  } }}
</script>

<script type="text/javascript">

  function ExportExcel(){
     $.post("{:url('ExportExcel')}",function(){
      alert("开发中..");
     });
  }
 
</script>
{/block}